{extend name='public/layout' /}
{block name='content'}
<div class="position"><p>您的当前位置：<a href="/">首页</a>  >  团购</p></div>
<div class="div_box">
    <h1 class="h1_title"><span class="h1_title_t">{$info.title}</span></h1>
    <script src="__JS__/amazeui.min.js"></script>
    <div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false}' >
        <ul class="am-slides">
            <li><img src="{$info.img}"/></li>
            {volist name='info.file' id='vo'}
            <li><img src="{$vo.url}" /></li>
            {/volist}
        </ul>
    </div>
    <div class="group_buy">
        {$info.info}
    </div>
</div>
<div class="div_box03">
    <div class="h_s_n3_t"><h1 class="h1_title"><span class="h1_title_t">团购报名</span></h1></div>
    <div class="pageSignUp">
        <dl>
            <dt>看房热线（24小时服务）<em>全程免费接机安排</em></dt>
            <dd><b>{$site.telphone}</b></dd>
        </dl>
        <form action="{:url('Ajax/addOrder')}" method="post" id="form">
        <ul>
            <li class="pageSignUp_ico16"><input type="text" placeholder="您的称呼"  class="itext" id="name" name="name"></li>
            <li class="pageSignUp_ico17"><input type="text" placeholder="您的手机号码"  class="itext" id="phone" name="phone"></li>
            <p><a href="javascript:;" class="but03" id="baoming_btn">提交报名</a></p>
        </ul>
        <input type="hidden" value="house_group" name='model' id="model">
        <input type="hidden" value="4" name="type" id="type">
        <input type="hidden" value="{$info.id}" name="house_id" id="house_id">
        </form>
    </div>
</div>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>
<script>
    $(function(){
        $('#baoming_btn').on('click',function(){
            var name = $.trim($('#name').val()),phone = $('#phone').val(),reg = /^1[34578][0-9]{9}$/;
            if(name.length == 0){
                layer.msg('请填写您的姓名',{icon:2});
                return false;
            }
            if(!reg.test(phone)){
                layer.msg('请填写正确的手机号码',{icon:2});
                return false;
            }
            layer.load(1);
            $('#form').submit();
        });
    });

    $('#form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        layer.closeAll();
        if(result.status == 1){
            layer.msg(result.msg,{icon:1});
            $('#name').val('');
            $('#phone').val('');
        } else {
            layer.msg(result.msg,{icon:2});
        }
    }
</script>
{/block}